package com.fagertveit.chainsawrus.font;

public class Glyph {
	public float x;
	public float y;
	public float width;
	public float height;
	public float xOffset;
	public float yOffset;
	public float xAdvance;
	public int page;
	public float u1;
	public float v1;
	public float u2;
	public float v2;
	
	public Glyph(float x, float y, float width, float height, float xOffset, float yOffset, float xAdvance, int page) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.xOffset = xOffset;
		this.yOffset = yOffset;
		this.xAdvance = xAdvance;
		this.page = page;
	}
	
	public void calcUV(float pageWidth, float pageHeight) {
		this.u1 = this.x / pageWidth;
		this.v1 = this.y / pageHeight;
		this.u2 = (this.x + this.width) / pageWidth;
		this.v2 = (this.y + this.height) / pageHeight;
	}
}
